{extend name="public:default" /}

<!-- 搜索栏 -->
{block name="inputBtn"}

    <div class="layui-inline marSelect">
        <div class="layui-input-inline">
        <select name="user_g_is_show">
            <option value="">请选择限制</option>
            <option value="1">显示</option>
            <option value="0">隐藏</option>
        </select>
        </div>
    </div>
    
    <div class="layui-inline marSelect">
        <div class="layui-input-inline">
        <select name="user_g_sex">
            <option value="">请选择性别</option>
            <option value="1">男</option>
            <option value="0">女</option>
        </select>
        </div>
    </div>

    <br>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>代理名称</legend>
            <input type="text" name="user_g_w_name" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>应用名称</legend>
            <input type="text" name="user_g_a_name" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>用户名称</legend>
            <input type="text" name="user_g_nickname" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>请选择日期</legend>
            <input type="text" name="user_g_times" placeholder="点此选择" class="layui-input" id="test-laydate-range-datetime" lay-key="1" readonly>
        </fieldset>
    </div>
    
{/block}

<!-- 头工具栏 -->
{block name="tableTopBtn"}
    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon"></i></button>
{/block}

<!-- 行工具栏 -->
{block name="tableEndBtn"}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit"><i class="layui-icon"></i></a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon"></i></a>
{/block}


{block name="script"}
    <script>
        var editList = window.location.pathname;
        var editAdd = editList + 'Add';
        var editDel = editList + 'Del';
        var editUp  = editList + 'Up';

        views.setUrl(editAdd,editDel,editUp).cols({
            url:editList,
            page:true,

            cols : [
                {type:'checkbox' , fixed: 'left'}

                ,{field:'id',title :"ID",align:'center'}
                ,{field:'user_g_w_name',title:"代理名称"}
                ,{field:'user_g_a_name',title:"应用名称",align:'center'}
                ,{field:'user_g_nickname',title :"用户名称",align:'center'}
                ,{field:'user_g_pic',title:"用户头像",algin:'center' , event:'img',width:100,templet:function(d){ return d.user_g_pic ? '<img src="'+d.user_g_pic+'" width="100%">' : '暂无用户头像'}}
                ,{field:'user_g_sexuser_g_sex',title:"性别",algin:'center' , 
                templet:function(d){
                    return d.user_g_sex == 1 ? '男' : '女';
                }
            }
                ,{field:'user_g_is_show',title:'是否显示',algin:'center' , 
                templet:function(d){
                    return d.user_g_is_show == 1 ? '是' : '否';
                }
            } 
                ,{field:'user_g_times',title:'添加时间',algin:'center' , templet:function(d){ return d.user_g_times ? layui.util.toDateString(d.user_g_times * 1000) : '' ; }}
                ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:150}
            ]
        }).toolbar(function(obj,data,table){
            // 头工具栏事件

        }).tool(function(obj,table){
            //监听行工具事件

        }).get();
    </script>
{/block}